package com.yugao.fintech.antelope.system.assembly;

import com.yugao.fintech.antelope.system.model.entity.SysRole;
import com.yugao.fintech.antelope.system.model.entity.SysRoleMenu;
import com.yugao.fintech.antelope.system.model.rqrs.role.*;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;


@Mapper(componentModel = "spring")
public interface SysRoleAssembly {
    @Mappings({
            @Mapping(source = "roleId", target = "id")
    })
    SysRole toRole(RoleDataScopeUpdateReq source);

    RoleResp toRoleResp(SysRole source);

    @Mappings({
            @Mapping(source = "permissionId", target = "menuId")
    })
    SysRoleMenu toRoleMenuRel(RolePermissionDataRuleSaveReq source);

    SysRole toRole(RoleSaveReq source);

    SysRole toRole(RoleUpdateReq source);
}
